package com.mooco.dongba.sys.dao;

import com.mooco.dongba.sys.pojo.SysUser;
import com.mooco.dongba.sys.pojo.SysUserDeptVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface SysUserDao {
    int getRowCount(String username);

    List<SysUserDeptVo> findPageObjects(String username, Integer startIndex, Integer pageSize);

    int validById(
            @Param("id") Integer id,
            @Param("valid") Integer valid,
            @Param("modifiedUser") String modifiedUser);

    int insertObject(SysUser entity);

    SysUserDeptVo findObjectById(Integer id);

    int updateObject(SysUser entity);

    /**
     * 修改用户密码
     * @param password
     * @param salt
     * @param id
     * @return
     */
    int updatePassword(
            @Param("password") String password,
            @Param("salt") String salt,
            @Param("id") Integer id);

    SysUser findUserByUserName(String username);
}
